package cn.bugstack.springframework;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * description: Bean工厂
 * taskId：
 * <pre>
 * change history:
 * date             defect#             person                comments
 * ---------------------------------------------------------------------
 * 2024/12/31       ********         zhaochaoyue        create file
 * </pre>
 *
 * @author: zhaochaoyue
 * @date: 2024/12/31 14:45
 * @copyright: 2024
 */
public class BeanFactory {
    
    private Map<String,BeanDefinition> beanDefinitionMap = new ConcurrentHashMap<>();
    
    public Object getBean(String name){
        return beanDefinitionMap.get(name).getBean();
    }
    
    public void registerBeanDefinition(String name,BeanDefinition beanDefinition){
        beanDefinitionMap.put(name, beanDefinition);
    }
    
}
